﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using QingzimaDB;

namespace QingzimaLogicModel
{
    public class ShuiLM : JichuLM
    {
        #region 属性区
        /// <summary>
        /// 产品名称
        /// </summary>        
        public string ChanpinMingcheng { get; set; }
        /// <summary>
        /// 产品描述
        /// </summary>        
        public string Miaoshu { get; set; }
        /// <summary>
        /// 公司名称
        /// </summary>        
        public string GongsiMingcheng { get; set; }
        /// <summary>
        /// 产品价格
        /// </summary>        
        public Decimal ChanpinJiage { get; set; }
        /// <summary>
        /// 产品图片
        /// </summary>        
        public string ChanpinTupian { get; set; }
        /// <summary>
        /// 产品库存
        /// </summary>        
        public int ChanpinKucun { get; set; }
        /// <summary>
        /// 产品销量
        /// </summary>        
        public int Xiaoliang { get; set; }
        /// <summary>
        /// 是否删除：未删除=0，删除=1
        /// </summary>        
        public int IsDel { get; set; }
        #endregion

        #region 构造区
        public ShuiLM()
        {

        }

        public ShuiLM(ShuiDB dbModel)
        {
            ID = dbModel.ID;
            Key = dbModel.Key;
            CreatedTime = dbModel.CreatedTime;
            ChanpinMingcheng = dbModel.ChanpinMingcheng;
            GongsiMingcheng = dbModel.GongsiMingcheng;
            ChanpinJiage = dbModel.ChanpinJiage;
            ChanpinTupian = dbModel.ChanpinTupian;
            ChanpinKucun = dbModel.ChanpinKucun;
            Xiaoliang = dbModel.Xiaoliang;
            Miaoshu = dbModel.Miaoshu;
        }
        #endregion

        #region 方法区
        public void Save()
        {
            ShuiDB dbModel = new ShuiDB();
            dbModel.ID = ID;
            dbModel.Key = Key;
            dbModel.CreatedTime = CreatedTime;
            dbModel.ChanpinMingcheng = ChanpinMingcheng;
            dbModel.GongsiMingcheng = GongsiMingcheng;
            dbModel.ChanpinJiage = ChanpinJiage;
            dbModel.ChanpinTupian = ChanpinTupian;
            dbModel.ChanpinKucun = ChanpinKucun;
            dbModel.Miaoshu = Miaoshu;
            dbModel.Xiaoliang = Xiaoliang;
            dbModel.Save();
        }
        #endregion
    }
}
